package com.baiduspring.utils.elasticsearch;

/**
 * es脚本代码
 *
 * @author xiongyan
 */
public enum ScriptTextEnum {
    //记录阅读量
    READ_NUM("ctx._source.readNum += 1"),
    //记录点赞量
    LIKES_NUM("ctx._source.likesNum += 1"),
    //记录收藏量
    COLLECT_NUM("ctx._source.collectNum += 1"),
    //减去记录收藏量
    SUB_COLLECT_NUM("ctx._source.collectNum -= 1");

    private String script;

    ScriptTextEnum(String script) {
        this.script = script;
    }

    public String getScript() {
        return script;
    }

    public void setScript(String script) {
        this.script = script;
    }
}
